#include <head.h>
// char *dest, const char *src

int main(int argc, char const *argv[])
{
    for (int i = 2; i <= argc ; i++)
    {
        // 打开文件
        FILE * fp_dest = fopen(argv[1] , "a+"); // 写入文件
        FOPEN_ERR(fp_dest);
        FILE * fp_src = fopen(argv[i] , "r+");  // 读取文件
        FOPEN_ERR(fp_src);
        // 移动到文件头部
        fseek(  fp_dest , 0 , SEEK_SET );
        fseek(  fp_dest , 0 , SEEK_SET );
        char buf[1024];                 // 临时缓冲区
        memset( buf , 0 , sizeof(buf));
        int byte = 0;
        while ((byte = fread( buf  , 1 , sizeof(buf) , fp_src)) > 0)
        {
            fwrite( buf  , 1 , byte , fp_dest);
        }
        fclose(fp_dest);
        fclose(fp_src);
    }
    return 0;
}